/*
 * @Author: Evanxu-home evanxu8023@163.com
 * @Date: 2023-06-23 14:43:52
 * @LastEditors: Evanxu-home evanxu8023@163.com
 * @LastEditTime: 2023-07-23 23:09:58
 * @FilePath: \program\drivers\drv_delay.c
 * @Description: 
 * 
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
 */
#include "drv_delay.h"

void delay_us(uint32_t nus)
{
#if 1
	uint32_t i = 0;
	while(nus-- > 0)
		for(i=0; i<48; i++);
#else
	uint32_t i=0;
	while(nus--)
	{
		i=6;
		while(i--) ;
	}
#endif
}


void delay_ms(uint32_t nms)
{
#if 0
	while(nms-- > 0)
		delay_us(1000);
#else
	uint32_t tickstart = 0;
	tickstart = get_sys_tick();
	while((get_sys_tick() - tickstart) < nms)
	{
	}
#endif
}




